<?php
require 'inc_security.php';
                       
$list = new dataGrid('req_id',30);
$list->add('req_name','Tên','string',1,0);
$list->add('','Thông tin người dùng','string',0,0);
$list->add('','Thông tin công ty','string',0,0);
$list->add('','Thông tin sản phẩm','string',0,0);
$list->add('','Xóa','delete');
$db_count = new db_count('SELECT count(*) as count 
                            FROM request
                            WHERE 1 '.$list->sqlSearch().'
                            ');
$total = $db_count->total;unset($db_count);

$db_listing = new db_query('SELECT * 
                            FROM request
                            WHERE 1 '.$list->sqlSearch().'
                            ORDER BY '.$list->sqlSort().' req_id DESC
                            '.$list->limit($total));
$total_row = mysql_num_rows($db_listing->result);


?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?=$load_header?>
</head>
<body>
<div id="wrapper">
   <div class="row">
      <div class="col-sm-12">
         <section class="panel">
            <header class="panel-heading">
               <?=$module_name?>
            </header>
            <div class="panel-body">
               <?=$list->showHeader($total_row,'')?>
               <?php
               $i = 0; 
               ?>
               <?php while($row = mysql_fetch_assoc($db_listing->result)){
                 $i++;
               ?>
               <?=$list->start_tr($i,$row['req_id'])?>
               <td>
                  <h3 style="font-size: 14px; font-weight: bold;"><?=$row['req_name']?></h3>
                  <label>Thời gian gửi : <?=date('d/m/Y - h:i a',$row['req_date'])?></label>
                </td>
                <td>
                  <p>Email: <?=$row['req_email']?></p>
                  <p>Điện thoại: <?=$row['req_phone']?></p>
                </td>
                <td>
                  <p>Công ty: <?=$row['req_company']?></p>
                  <p>Chức vụ: <?=$row['req_position']?></p>
                  <p>Địa chỉ: <?=$row['req_address']?></p>
                </td>
                <td>
                    <p>Sản phẩm: <?=$row['req_product']?></p>
                  <p>Số lượng: <?=$row['req_number']?></p>
                  <p>Thời gian: <?=$row['req_time']?></p>
                </td>
                <?=$list->showDelete($row['req_id'])?>
               <?=$list->end_tr()?>
               <?}?>
               <?=$list->showFooter()?>
            </div>
         </section>
      </div>
   </div>
</div>
</body>
</html>